using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._ConversionTools._JSON
{
    /// <summary>
    /// <para>Features To JSON</para>
    /// <para>Converts features to  JSON or GeoJSON format. The fields, geometry, and spatial reference of  features will be converted to their corresponding  JSON representation and written to a file with a .json or  .geojson extension.</para>
    /// <para>将要素转换为 JSON 或 GeoJSON 格式。要素的字段、几何和空间参考将转换为其相应的 JSON 表示，并写入扩展名为 .json 或 .geojson 的文件。</para>
    /// </summary>    
    [DisplayName("Features To JSON")]
    public class FeaturesToJSON : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public FeaturesToJSON()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_features">
        /// <para>Input Features</para>
        /// <para>The features to convert to JSON.</para>
        /// <para>要转换为 JSON 的功能。</para>
        /// </param>
        /// <param name="_out_json_file">
        /// <para>Output JSON</para>
        /// <para>The output JSON or GeoJSON file.</para>
        /// <para>输出 JSON 或 GeoJSON 文件。</para>
        /// </param>
        public FeaturesToJSON(object _in_features, object _out_json_file)
        {
            this._in_features = _in_features;
            this._out_json_file = _out_json_file;
        }
        public override string ToolboxName => "Conversion Tools";

        public override string ToolName => "Features To JSON";

        public override string CallName => "conversion.FeaturesToJSON";

        public override List<string> AcceptEnvironments => ["scratchWorkspace", "workspace"];

        public override object[] ParameterInfo => [_in_features, _out_json_file, _format_json.GetGPValue(), _include_z_values.GetGPValue(), _include_m_values.GetGPValue(), _geoJSON.GetGPValue(), _outputToWGS84.GetGPValue(), _use_field_alias.GetGPValue()];

        /// <summary>
        /// <para>Input Features</para>
        /// <para>The features to convert to JSON.</para>
        /// <para>要转换为 JSON 的功能。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_features { get; set; }


        /// <summary>
        /// <para>Output JSON</para>
        /// <para>The output JSON or GeoJSON file.</para>
        /// <para>输出 JSON 或 GeoJSON 文件。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output JSON")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_json_file { get; set; }


        /// <summary>
        /// <para>Formatted JSON</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the JSON will be formatted to improve readability similar to the ArcGIS REST API specification's PJSON (Pretty JSON) format.</para>
        ///   <para>
        ///     <bulletList>
        ///       <bullet_item>Unchecked—The features will not be formatted. This is the default.</bullet_item><para/>
        ///       <bullet_item>Checked—The features will be formatted to the PJSON specification.</bullet_item><para/>
        ///     </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是否对 JSON 进行格式化，以提高可读性，类似于 ArcGIS REST API 规范的 PJSON （Pretty JSON） 格式。</para>
        ///   <para>
        ///     <bulletList>
        ///       <bullet_item>未选中 - 不会设置要素的格式。这是默认设置。</bullet_item><para/>
        ///       <bullet_item>选中 - 要素的格式将设置为 PJSON 规范。</bullet_item><para/>
        ///     </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Formatted JSON")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _format_json_value _format_json { get; set; } = _format_json_value._false;

        public enum _format_json_value
        {
            /// <summary>
            /// <para>FORMATTED</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("FORMATTED")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NOT_FORMATTED</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NOT_FORMATTED")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Include Z Values</para>
        /// <para><xdoc>
        ///   <para>Specifies whether to include z-values of the features to the JSON.</para>
        ///   <para>
        ///     <bulletList>
        ///       <bullet_item>Unchecked—The z-values will not be included in geometries, and the hasZ property of the JSON will not be included. This is the default.</bullet_item><para/>
        ///       <bullet_item>Checked—The z-values will be included in geometries, and the hasZ property of the JSON will be set to true.</bullet_item><para/>
        ///     </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是否将要素的 z 值包含在 JSON 中。</para>
        ///   <para>
        ///     <bulletList>
        ///       <bullet_item>未选中 - 几何中将不包括 z 值，并且 JSON 的 hasZ 属性将不包括在内。这是默认设置。</bullet_item><para/>
        ///       <bullet_item>选中 - z 值将包含在几何中，并且 JSON 的 hasZ 属性将设置为 true。</bullet_item><para/>
        ///     </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Include Z Values")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _include_z_values_value _include_z_values { get; set; } = _include_z_values_value._false;

        public enum _include_z_values_value
        {
            /// <summary>
            /// <para>Z_VALUES</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("Z_VALUES")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_Z_VALUES</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_Z_VALUES")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Include M Values</para>
        /// <para><xdoc>
        ///   <para>Specifies whether to include m-values of the features to the JSON.</para>
        ///   <para>
        ///     <bulletList>
        ///       <bullet_item>Unchecked—The m-values will not be included in geometries, and the hasM property of the JSON will not be included. This is the default.</bullet_item><para/>
        ///       <bullet_item>Checked—The m-values will be included in geometries, and the hasM property of the JSON will be set to true.</bullet_item><para/>
        ///     </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是否将要素的 m 值包含在 JSON 中。</para>
        ///   <para>
        ///     <bulletList>
        ///       <bullet_item>未选中 - 几何中将不包括 m 值，并且 JSON 的 hasM 属性将不包括在内。这是默认设置。</bullet_item><para/>
        ///       <bullet_item>选中 - m 值将包含在几何中，并且 JSON 的 hasM 属性将设置为 true。</bullet_item><para/>
        ///     </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Include M Values")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _include_m_values_value _include_m_values { get; set; } = _include_m_values_value._false;

        public enum _include_m_values_value
        {
            /// <summary>
            /// <para>M_VALUES</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("M_VALUES")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_M_VALUES</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_M_VALUES")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Output to GeoJSON</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the output will be created as GeoJSON.</para>
        ///   <para>
        ///     <bulletList>
        ///       <bullet_item>Unchecked—The output will be created as Esri JSON (.json). This is the default.</bullet_item><para/>
        ///       <bullet_item>Checked—The output will be created in the GeoJSON format (.geojson).</bullet_item><para/>
        ///     </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是否将输出创建为 GeoJSON。</para>
        ///   <para>
        ///     <bulletList>
        ///       <bullet_item>未选中 - 输出将创建为 Esri JSON （.json）。这是默认设置。</bullet_item><para/>
        ///       <bullet_item>选中 - 输出将以 GeoJSON 格式 （.geojson） 创建。</bullet_item><para/>
        ///     </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output to GeoJSON")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _geoJSON_value _geoJSON { get; set; } = _geoJSON_value._false;

        public enum _geoJSON_value
        {
            /// <summary>
            /// <para>GEOJSON</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("GEOJSON")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_GEOJSON</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_GEOJSON")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Project to WGS_1984</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the input features will be projected to the geographic coordinate system WGS_1984 with a default geographic transformation. This parameter only applies when the output is GeoJSON.</para>
        ///   <para>
        ///     <bulletList>
        ///       <bullet_item>Checked—Features will be projected to WGS_1984.</bullet_item><para/>
        ///       <bullet_item>Unchecked—Features will not be projected to WGS_1984. The GeoJSON will contain a CRS tag that defines the coordinate system. This is the default.</bullet_item><para/>
        ///     </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是否使用默认地理变换将输入要素投影到地理坐标系WGS_1984。仅当输出为 GeoJSON 时，此参数才适用。</para>
        ///   <para>
        ///     <bulletList>
        ///       <bullet_item>选中 - 要素将投影到WGS_1984。</bullet_item><para/>
        ///       <bullet_item>未选中 - 要素将不投影到WGS_1984。GeoJSON 将包含定义坐标系的 CRS 标记。这是默认设置。</bullet_item><para/>
        ///     </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Project to WGS_1984")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _outputToWGS84_value _outputToWGS84 { get; set; } = _outputToWGS84_value._false;

        public enum _outputToWGS84_value
        {
            /// <summary>
            /// <para>WGS84</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("WGS84")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>KEEP_INPUT_SR</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("KEEP_INPUT_SR")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Use field aliases</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the output file will use field aliases for feature attributes.</para>
        ///   <para>
        ///     <bulletList>
        ///       <bullet_item>Unchecked—Output feature attributes will use field names. This is the default.</bullet_item><para/>
        ///       <bullet_item>Checked—Output feature attributes will use field aliases.</bullet_item><para/>
        ///     </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定输出文件是否对要素属性使用字段别名。</para>
        ///   <para>
        ///     <bulletList>
        ///       <bullet_item>未选中 - 输出要素属性将使用字段名称。这是默认设置。</bullet_item><para/>
        ///       <bullet_item>选中 - 输出要素属性将使用字段别名。</bullet_item><para/>
        ///     </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Use field aliases")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _use_field_alias_value _use_field_alias { get; set; } = _use_field_alias_value._false;

        public enum _use_field_alias_value
        {
            /// <summary>
            /// <para>USE_FIELD_ALIAS</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("USE_FIELD_ALIAS")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>USE_FIELD_NAME</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("USE_FIELD_NAME")]
            [GPEnumValue("false")]
            _false,

        }

        public FeaturesToJSON SetEnv(object scratchWorkspace = null, object workspace = null)
        {
            base.SetEnv(scratchWorkspace: scratchWorkspace, workspace: workspace);
            return this;
        }

    }

}